import pandas as pd
import make_models as mm
import make_plots as mp

'''
Overlooked biases from misidentifications of causal structures
Cenci S. The Journal of Finance and Data Science (2024)
'''

#%% Figure 1: Biased confounders
res = mm.fig1()
l = pd.DataFrame()
for _ in range(500):
    if _ %50==0:print(_)
    r = mm.fig1bottom()
    l = pd.concat((l, r))
mp.make_fig_1_plot(res, l)
#%% Figure 2: Non-omitted variable bias
res, l_coeff = mm.fig2_top(1)
dx, z = mm.fig2_bottom()
mp.make_fig_2_plot(res, dx, z)

#%% Figure 3: Inconsistent comparisons
res = mm.fig3()
mp.make_fig_3_plot(res)